<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Contracts\WxProfitSharing;

class TestPSController extends Controller
{
    public function index(WxProfitSharing $profitSharing)
    {
        $channel = 'test';
        $transId = '44018688555';
        $subAppId = '55855';
        $subMchId = '13855465';
        $profitSharingReceivers = [
            [
                'profit_sharing_order_id'=>'11111',
                'accounts'=>[
                    'type'=>'mchid',
                    'amount'=>0.01,
                    'desc'=>'desc',
                    'name'=>'hhh'
                ]
            ]
        ];
        return $profitSharing->req($channel, $transId, $subAppId, $subMchId, $profitSharingReceivers);
    }

    public function multi(WxProfitSharing $profitSharing)
    {
       
        return $profitSharing->profitSharing();  //单次分账测试
    }

    public function add(WxProfitSharing $profitSharing)
    {
        $rec = [
            'type'=>'PERSONAL_WECHATID',
            'account'=>'weichat594',
            'name'=>'谢文贵',
            'relation_type'=>'PARTNER'
        ];
        return $profitSharing->removeReceiver('wx321f8250fec315e0','1599153871',$rec);
    }
}
